package centerberg.engine;

import java.io.File;
import java.util.HashMap;

public class SoundLoader {
    private HashMap<String, Sound> sounds;
    
    public SoundLoader() {
        sounds = new HashMap<String, Sound>();
    }
    
    public Sound getSound(String sound) {
        return sounds.get(sound);
    }
    public void addSound(String name, String filepath) {
        if(sounds.get(name) == null)
            sounds.put(name, new Sound(new File(filepath)));
        else
            throw new IllegalArgumentException("A soundfile with that name already exists");
    }
}
